
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>高级用法（Advanced Techniques） · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="summary.html" />
    
    
    <link rel="prev" href="delegate.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../meet_qt_5/">
            
                <a href="../meet_qt_5/">
            
                    
                    Qt5概述
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../meet_qt_5/preface.html">
            
                <a href="../meet_qt_5/preface.html">
            
                    
                    序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../meet_qt_5/qt5_introduction.html">
            
                <a href="../meet_qt_5/qt5_introduction.html">
            
                    
                    Qt5介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../meet_qt_5/qt_building_blocks.html">
            
                <a href="../meet_qt_5/qt_building_blocks.html">
            
                    
                    Qt构建模块（Qt Building Blocks）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../meet_qt_5/qt_project.html">
            
                <a href="../meet_qt_5/qt_project.html">
            
                    
                    Qt项目（Qt Project）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../get_start/">
            
                <a href="../get_start/">
            
                    
                    开始学习（Get Start）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../get_start/qt5installing_qt_5_sdk.html">
            
                <a href="../get_start/qt5installing_qt_5_sdk.html">
            
                    
                    安装Qt5软件工具包（Installing Qt 5 SDK）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../get_start/hello_world.html">
            
                <a href="../get_start/hello_world.html">
            
                    
                    你好世界（Hello World）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../get_start/application_types.html">
            
                <a href="../get_start/application_types.html">
            
                    
                    应用程序类型（Application Types）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../get_start/summary.html">
            
                <a href="../get_start/summary.html">
            
                    
                    总结（ Summary）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../qt_creator_ide/">
            
                <a href="../qt_creator_ide/">
            
                    
                    Qt Creator集成开发环境（Qt Creator IDE）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../qt_creator_ide/the_user_interface.html">
            
                <a href="../qt_creator_ide/the_user_interface.html">
            
                    
                    用户界面（The User Interface）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../qt_creator_ide/qtregistering_your_qt_kit.html">
            
                <a href="../qt_creator_ide/qtregistering_your_qt_kit.html">
            
                    
                    注册你的Qt工具箱（Registering your Qt Kit）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../qt_creator_ide/managing_projects.html">
            
                <a href="../qt_creator_ide/managing_projects.html">
            
                    
                    项目管理（Managing Projects）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../qt_creator_ide/using_the_editor.html">
            
                <a href="../qt_creator_ide/using_the_editor.html">
            
                    
                    使用编辑器（Using the Editor）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../qt_creator_ide/locator.html">
            
                <a href="../qt_creator_ide/locator.html">
            
                    
                    定位器（Locator）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../qt_creator_ide/debugging.html">
            
                <a href="../qt_creator_ide/debugging.html">
            
                    
                    调试（Debugging）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../qt_creator_ide/shortcuts.html">
            
                <a href="../qt_creator_ide/shortcuts.html">
            
                    
                    快捷键（Shortcuts）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../quick_starter/">
            
                <a href="../quick_starter/">
            
                    
                    QML快速入门（Quick Starter）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../quick_starter/qmlqml_syntax.html">
            
                <a href="../quick_starter/qmlqml_syntax.html">
            
                    
                    QML语法（QML Syntax）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../quick_starter/basic_elements.html">
            
                <a href="../quick_starter/basic_elements.html">
            
                    
                    基本元素（Basic Elements）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../quick_starter/compontents.html">
            
                <a href="../quick_starter/compontents.html">
            
                    
                    组件（Compontents）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../quick_starter/simple_transformations.html">
            
                <a href="../quick_starter/simple_transformations.html">
            
                    
                    简单的转换（Simple Transformations）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../quick_starter/positioning_element.html">
            
                <a href="../quick_starter/positioning_element.html">
            
                    
                    定位元素（Positioning Element）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../quick_starter/layout_items.html">
            
                <a href="../quick_starter/layout_items.html">
            
                    
                    布局元素（Layout Items）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="../quick_starter/input_element.html">
            
                <a href="../quick_starter/input_element.html">
            
                    
                    输入元素（Input Element）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="../quick_starter/advanced_techniques.html">
            
                <a href="../quick_starter/advanced_techniques.html">
            
                    
                     高级用法（Advanced Techniques）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../fluid_elements/">
            
                <a href="../fluid_elements/">
            
                    
                    动态元素（Fluid Elements）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../fluid_elements/animations.html">
            
                <a href="../fluid_elements/animations.html">
            
                    
                    动画（Animations）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../fluid_elements/states_and_transitions.html">
            
                <a href="../fluid_elements/states_and_transitions.html">
            
                    
                    状态与过渡（States and Transitions）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../fluid_elements/advanced_techniques.html">
            
                <a href="../fluid_elements/advanced_techniques.html">
            
                    
                    高级用法（Advanced Techniques）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="./">
            
                <a href="./">
            
                    
                    模型-视图-代理（Model-View-Delegate）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="concept.html">
            
                <a href="concept.html">
            
                    
                    概念（Concept）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="basic_model.html">
            
                <a href="basic_model.html">
            
                    
                    基础模型（Basic Model）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="dynamic_views.html">
            
                <a href="dynamic_views.html">
            
                    
                    动态视图（Dynamic Views）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="delegate.html">
            
                <a href="delegate.html">
            
                    
                    代理（Delegate）
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.7.5" data-path="advanced_techniques.html">
            
                <a href="advanced_techniques.html">
            
                    
                    高级用法（Advanced Techniques）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="summary.html">
            
                <a href="summary.html">
            
                    
                    总结（Summary）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../canvas_element/">
            
                <a href="../canvas_element/">
            
                    
                    画布元素（Canvas Element）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../canvas_element/convenient_api.html">
            
                <a href="../canvas_element/convenient_api.html">
            
                    
                    便捷的接口（Convenient API）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../canvas_element/gradients.html">
            
                <a href="../canvas_element/gradients.html">
            
                    
                    渐变（Gradients）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../canvas_element/shadows.html">
            
                <a href="../canvas_element/shadows.html">
            
                    
                    阴影（Shadows）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../canvas_element/images.html">
            
                <a href="../canvas_element/images.html">
            
                    
                    图片（Images）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../canvas_element/transformation.html">
            
                <a href="../canvas_element/transformation.html">
            
                    
                    转换（Transformation）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../canvas_element/composition_mode.html">
            
                <a href="../canvas_element/composition_mode.html">
            
                    
                    组合模式（Composition Mode）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../canvas_element/pixels_buffer.html">
            
                <a href="../canvas_element/pixels_buffer.html">
            
                    
                    像素缓冲（Pixels Buffer）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../canvas_element/canvas_paint.html">
            
                <a href="../canvas_element/canvas_paint.html">
            
                    
                    画布绘制（Canvas Paint）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../canvas_element/html5porting_from_html5_canvas.html">
            
                <a href="../canvas_element/html5porting_from_html5_canvas.html">
            
                    
                    HTML5画布移植（Porting from HTML5 Canvas）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../particle_simulations/">
            
                <a href="../particle_simulations/">
            
                    
                    粒子模拟（Particle Simulations）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../particle_simulations/concept.html">
            
                <a href="../particle_simulations/concept.html">
            
                    
                    概念（Concept）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../particle_simulations/simple_simulation.html">
            
                <a href="../particle_simulations/simple_simulation.html">
            
                    
                    简单的模拟（Simple Simulation）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../particle_simulations/particle_parameters.html">
            
                <a href="../particle_simulations/particle_parameters.html">
            
                    
                    粒子参数（Particle Parameters）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../particle_simulations/directed_particle.html">
            
                <a href="../particle_simulations/directed_particle.html">
            
                    
                    粒子方向（Directed Particle）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../particle_simulations/particle_painter.html">
            
                <a href="../particle_simulations/particle_painter.html">
            
                    
                    粒子画笔（Particle Painter）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="../particle_simulations/affecting_particles.html">
            
                <a href="../particle_simulations/affecting_particles.html">
            
                    
                    粒子控制（Affecting Particles）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" data-path="../particle_simulations/particle_group.html">
            
                <a href="../particle_simulations/particle_group.html">
            
                    
                    粒子组（Particle Group）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.8" data-path="../particle_simulations/summary.html">
            
                <a href="../particle_simulations/summary.html">
            
                    
                    总结（Summary）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../shader_effect/">
            
                <a href="../shader_effect/">
            
                    
                    着色器效果（Shader Effect）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../shader_effect/openglopengl_shader.html">
            
                <a href="../shader_effect/openglopengl_shader.html">
            
                    
                    OpenGL着色器（OpenGL Shader）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../shader_effect/shader_elements.html">
            
                <a href="../shader_effect/shader_elements.html">
            
                    
                    着色器元素（Shader Elements）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../shader_effect/fragement_shader.html">
            
                <a href="../shader_effect/fragement_shader.html">
            
                    
                    片段着色器（Fragement Shader）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../shader_effect/wave_effect.html">
            
                <a href="../shader_effect/wave_effect.html">
            
                    
                    波浪效果（Wave Effect）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../shader_effect/vertex_shader.html">
            
                <a href="../shader_effect/vertex_shader.html">
            
                    
                    顶点着色器（Vertex Shader）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../shader_effect/curtain_effect.html">
            
                <a href="../shader_effect/curtain_effect.html">
            
                    
                    剧幕效果（Curtain Effect）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.7" data-path="../shader_effect/qtqt_graphicseffect_library.html">
            
                <a href="../shader_effect/qtqt_graphicseffect_library.html">
            
                    
                    Qt图像效果库（Qt GraphicsEffect Library）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../multimedia/">
            
                <a href="../multimedia/">
            
                    
                    多媒体（Multimedia）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../multimedia/playing_media.html">
            
                <a href="../multimedia/playing_media.html">
            
                    
                    媒体播放（Playing Media）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../multimedia/sounds_effects.html">
            
                <a href="../multimedia/sounds_effects.html">
            
                    
                    声音效果（Sounds Effects）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../multimedia/video_streams.html">
            
                <a href="../multimedia/video_streams.html">
            
                    
                    视频流（Video Streams）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../multimedia/capturing_images.html">
            
                <a href="../multimedia/capturing_images.html">
            
                    
                    捕捉图像（Capturing Images）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../multimedia/advanced_techniques.html">
            
                <a href="../multimedia/advanced_techniques.html">
            
                    
                    高级用法（Advanced Techniques）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../multimedia/summary.html">
            
                <a href="../multimedia/summary.html">
            
                    
                    总结（Summary）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../networking/">
            
                <a href="../networking/">
            
                    
                    网络（Networking）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../networking/httpuiserving_ui_via_http.html">
            
                <a href="../networking/httpuiserving_ui_via_http.html">
            
                    
                    通过HTTP服务UI（Serving UI via HTTP）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="../networking/templating.html">
            
                <a href="../networking/templating.html">
            
                    
                    模板（Templating）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="../networking/httphttp_requests.html">
            
                <a href="../networking/httphttp_requests.html">
            
                    
                    HTTP请求（HTTP Requests）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.4" data-path="../networking/local_files.html">
            
                <a href="../networking/local_files.html">
            
                    
                    本地文件（Local files）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.5" data-path="../networking/restrest_api.html">
            
                <a href="../networking/restrest_api.html">
            
                    
                    REST接口（REST API）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.6" data-path="../networking/authentication_using_oauth.html">
            
                <a href="../networking/authentication_using_oauth.html">
            
                    
                    使用开放授权登陆验证（Authentication using OAuth）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.7" data-path="../networking/engine_io.html">
            
                <a href="../networking/engine_io.html">
            
                    
                    云服务（Engine IO）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.8" data-path="../networking/web_sockets.html">
            
                <a href="../networking/web_sockets.html">
            
                    
                    Web Sockets
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.9" data-path="../networking/summary.html">
            
                <a href="../networking/summary.html">
            
                    
                    总结（Summary）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../storage/">
            
                <a href="../storage/">
            
                    
                    存储（Storage）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../storage/settings.html">
            
                <a href="../storage/settings.html">
            
                    
                    配置（Settings）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../storage/local_storage_-_sql.html">
            
                <a href="../storage/local_storage_-_sql.html">
            
                    
                    本地存储 - SQL（Local Storage - SQL）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../storage/other_storage_apis.html">
            
                <a href="../storage/other_storage_apis.html">
            
                    
                    其它存储接口（Other Storage APIs）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../dynamic_qml/">
            
                <a href="../dynamic_qml/">
            
                    
                    动态QML（Dynamic QML）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../dynamic_qml/loading_components_dynamically.html">
            
                <a href="../dynamic_qml/loading_components_dynamically.html">
            
                    
                    动态加载组件（Loading Components Dynamically）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1.1" data-path="../dynamic_qml/connecting_indirectly.html">
            
                <a href="../dynamic_qml/connecting_indirectly.html">
            
                    
                    间接连接（Connecting Indirectly）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.1.2" data-path="../dynamic_qml/binding_indirectly.html">
            
                <a href="../dynamic_qml/binding_indirectly.html">
            
                    
                    间接绑定（Binding Indirectly）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../dynamic_qml/creating_and_destroying_objects.html">
            
                <a href="../dynamic_qml/creating_and_destroying_objects.html">
            
                    
                    创建与销毁对象（Creating and Destroying Objects）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.2.1" data-path="../dynamic_qml/dynamically_loading_and_instantiating_items.html">
            
                <a href="../dynamic_qml/dynamically_loading_and_instantiating_items.html">
            
                    
                    动态加载和实例化项（Dynamically Loading and Instantiating Items）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2.2" data-path="../dynamic_qml/dynamically_instantiating_items_from_text.html">
            
                <a href="../dynamic_qml/dynamically_instantiating_items_from_text.html">
            
                    
                    从文本中动态实例化项（Dynamically Instantiating Items from Text）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2.3" data-path="../dynamic_qml/managing_dynamically_created_elements.html">
            
                <a href="../dynamic_qml/managing_dynamically_created_elements.html">
            
                    
                    管理动态创建的元素（Managing Dynamically Created Elements）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../dynamic_qml/tracking_dynamic_objects.html">
            
                <a href="../dynamic_qml/tracking_dynamic_objects.html">
            
                    
                    跟踪动态对象（Tracking Dynamic Objects）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="../dynamic_qml/summary.html">
            
                <a href="../dynamic_qml/summary.html">
            
                    
                    总结（Summary）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../javascript/">
            
                <a href="../javascript/">
            
                    
                    JavaScript
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../javascript/browserhtml_vs_qtquickqml.html">
            
                <a href="../javascript/browserhtml_vs_qtquickqml.html">
            
                    
                    浏览器/HTML与QtQuick/QML对比（Browser/HTML vs QtQuick/QML）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="../javascript/the_language.html">
            
                <a href="../javascript/the_language.html">
            
                    
                    JavaScript语法（The Language）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="../javascript/js_objects.html">
            
                <a href="../javascript/js_objects.html">
            
                    
                    JS对象（JS Objects）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="../javascript/creating_a_js_console.html">
            
                <a href="../javascript/creating_a_js_console.html">
            
                    
                    创建JS控制台（Creating a JS Console）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="../qt_and_c++/">
            
                <a href="../qt_and_c++/">
            
                    
                    Qt and C++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.16.1" data-path="../qt_and_c++/a_boilerplate_application.html">
            
                <a href="../qt_and_c++/a_boilerplate_application.html">
            
                    
                    演示程序（A Boilerplate Application）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.2" data-path="../qt_and_c++/the_qobject.html">
            
                <a href="../qt_and_c++/the_qobject.html">
            
                    
                    Qt对象（The QObject）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.3" data-path="../qt_and_c++/build_systems.html">
            
                <a href="../qt_and_c++/build_systems.html">
            
                    
                    编译系统（Build Systems）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.16.3.1" data-path="../qt_and_c++/qmake.html">
            
                <a href="../qt_and_c++/qmake.html">
            
                    
                    QMake
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.3.2" data-path="../qt_and_c++/cmake.html">
            
                <a href="../qt_and_c++/cmake.html">
            
                    
                    CMake
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.16.4" data-path="../qt_and_c++/common_qt_classes.html">
            
                <a href="../qt_and_c++/common_qt_classes.html">
            
                    
                    Qt通用类（Common Qt Classes）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.16.4.1" data-path="../qt_and_c++/qstring.html">
            
                <a href="../qt_and_c++/qstring.html">
            
                    
                    QString
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.4.2" data-path="../qt_and_c++/sequential_containers.html">
            
                <a href="../qt_and_c++/sequential_containers.html">
            
                    
                    顺序容器（Sequential Containers）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.4.3" data-path="../qt_and_c++/associative_containers.html">
            
                <a href="../qt_and_c++/associative_containers.html">
            
                    
                    组合容器（Associative Containers）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.4.4" data-path="../qt_and_c++/file_io.html">
            
                <a href="../qt_and_c++/file_io.html">
            
                    
                    文件IO（File IO）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.16.5" data-path="../qt_and_c++/models_in_c++.html">
            
                <a href="../qt_and_c++/models_in_c++.html">
            
                    
                    C++数据模型（Models in C++）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.16.5.1" data-path="../qt_and_c++/a_simple_model.html">
            
                <a href="../qt_and_c++/a_simple_model.html">
            
                    
                    一个简单的模型（A simple model）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.5.2" data-path="../qt_and_c++/more_complex_data.html">
            
                <a href="../qt_and_c++/more_complex_data.html">
            
                    
                    更复杂的数据（More Complex Data）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.5.3" data-path="../qt_and_c++/dynamic_data.html">
            
                <a href="../qt_and_c++/dynamic_data.html">
            
                    
                    动态数据（Dynamic Data）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.5.4" data-path="../qt_and_c++/advanced_techniques.html">
            
                <a href="../qt_and_c++/advanced_techniques.html">
            
                    
                    进阶技巧（Advanced Techniques）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="../extending_qml_with_c++/">
            
                <a href="../extending_qml_with_c++/">
            
                    
                    C++扩展QML（Extending QML with C++）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.1" data-path="../extending_qml_with_c++/understanding_the_qml_run-time.html">
            
                <a href="../extending_qml_with_c++/understanding_the_qml_run-time.html">
            
                    
                    理解QML运行环境（Understanding the QML Run-time）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.2" data-path="../extending_qml_with_c++/plugin_content.html">
            
                <a href="../extending_qml_with_c++/plugin_content.html">
            
                    
                    插件内容（Plugin Content）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.3" data-path="../extending_qml_with_c++/creating_the_plugin.html">
            
                <a href="../extending_qml_with_c++/creating_the_plugin.html">
            
                    
                    创建插件（Creating the plugin）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.4" data-path="../extending_qml_with_c++/fileio_implementation.html">
            
                <a href="../extending_qml_with_c++/fileio_implementation.html">
            
                    
                    FileIO实现（FileIO Implementation）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5" data-path="../extending_qml_with_c++/using_fileio.html">
            
                <a href="../extending_qml_with_c++/using_fileio.html">
            
                    
                    使用FileIO（Using FileIO）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.5.1" data-path="../extending_qml_with_c++/the_application_window.html">
            
                <a href="../extending_qml_with_c++/the_application_window.html">
            
                    
                    应用程序窗口（The Application Window）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5.2" data-path="../extending_qml_with_c++/using_actions.html">
            
                <a href="../extending_qml_with_c++/using_actions.html">
            
                    
                    使用动作（Using Actions）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5.3" data-path="../extending_qml_with_c++/formatting_the_table.html">
            
                <a href="../extending_qml_with_c++/formatting_the_table.html">
            
                    
                    格式化表格（Formatting the Table）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5.4" data-path="../extending_qml_with_c++/reading_data.html">
            
                <a href="../extending_qml_with_c++/reading_data.html">
            
                    
                    读取数据（Reading Data）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5.5" data-path="../extending_qml_with_c++/writing_data.html">
            
                <a href="../extending_qml_with_c++/writing_data.html">
            
                    
                    写入数据（Writing Data）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5.6" data-path="../extending_qml_with_c++/finishing_touch.html">
            
                <a href="../extending_qml_with_c++/finishing_touch.html">
            
                    
                    收尾工作（Finishing Touch）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.17.6" data-path="../extending_qml_with_c++/summary.html">
            
                <a href="../extending_qml_with_c++/summary.html">
            
                    
                    总结（Summary）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="../other/">
            
                <a href="../other/">
            
                    
                    其它（Other）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.18.1" data-path="../other/assets.html">
            
                <a href="../other/assets.html">
            
                    
                    示例源码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.2" data-path="../other/enginsh_to_chinses.html">
            
                <a href="../other/enginsh_to_chinses.html">
            
                    
                    术语英汉对照表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.3" data-path="../other/book_format.html">
            
                <a href="../other/book_format.html">
            
                    
                    格式定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.4" data-path="../other/collaboration_correction.html">
            
                <a href="../other/collaboration_correction.html">
            
                    
                    协作校正
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >高级用法（Advanced Techniques）</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x9AD8;&#x7EA7;&#x7528;&#x6CD5;&#xFF08;advanced-techniques&#xFF09;">&#x9AD8;&#x7EA7;&#x7528;&#x6CD5;&#xFF08;Advanced Techniques&#xFF09;</h1>
<h2 id="651-&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;the-pathview&#xFF09;">6.5.1 &#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;The PathView&#xFF09;</h2>
<p>&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x975E;&#x5E38;&#x5F3A;&#x5927;&#xFF0C;&#x4F46;&#x4E5F;&#x975E;&#x5E38;&#x590D;&#x6742;&#xFF0C;&#x8FD9;&#x4E2A;&#x89C6;&#x56FE;&#x7531;QtQuick&#x63D0;&#x4F9B;&#x3002;&#x5B83;&#x521B;&#x5EFA;&#x4E86;&#x4E00;&#x4E2A;&#x53EF;&#x4EE5;&#x8BA9;&#x5B50;&#x9879;&#x6CBF;&#x7740;&#x4EFB;&#x610F;&#x8DEF;&#x5F84;&#x79FB;&#x52A8;&#x7684;&#x89C6;&#x56FE;&#x3002;&#x6CBF;&#x7740;&#x76F8;&#x540C;&#x7684;&#x8DEF;&#x5F84;&#xFF0C;&#x4F7F;&#x7528;&#x7F29;&#x653E;&#xFF08;scale&#xFF09;&#xFF0C;&#x900F;&#x660E;&#xFF08;opacity&#xFF09;&#x7B49;&#x5143;&#x7D20;&#x53EF;&#x4EE5;&#x66F4;&#x52A0;&#x8BE6;&#x7EC6;&#x7684;&#x63A7;&#x5236;&#x8FC7;&#x7A0B;&#x3002;</p>
<p>&#x5F53;&#x4F7F;&#x7528;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x65F6;&#xFF0C;&#x4F60;&#x5FC5;&#x987B;&#x5B9A;&#x4E49;&#x4E00;&#x4E2A;&#x4EE3;&#x7406;&#x548C;&#x4E00;&#x4E2A;&#x8DEF;&#x5F84;&#x3002;&#x5728;&#x8FD9;&#x4E9B;&#x4E4B;&#x4E0A;&#xFF0C;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x672C;&#x8EAB;&#x4E5F;&#x53EF;&#x4EE5;&#x81EA;&#x5B9A;&#x4E49;&#x4E00;&#x4E9B;&#x5C5E;&#x6027;&#x7684;&#x533A;&#x95F4;&#x3002;&#x901A;&#x5E38;&#x4F1A;&#x4F7F;&#x7528;pathItemCount&#x5C5E;&#x6027;&#xFF0C;&#x5B83;&#x63A7;&#x5236;&#x4E86;&#x4E00;&#x6B21;&#x53EF;&#x89C1;&#x7684;&#x5B50;&#x9879;&#x603B;&#x6570;&#x3002;preferredHighLightBegin&#x5C5E;&#x6027;&#x63A7;&#x5236;&#x4E86;&#x9AD8;&#x4EAE;&#x533A;&#x95F4;&#xFF0C;preferredHighlightEnd&#x4E0E;highlightRangeMode&#xFF0C;&#x63A7;&#x5236;&#x4E86;&#x5F53;&#x524D;&#x9879;&#x600E;&#x6837;&#x6CBF;&#x7740;&#x8DEF;&#x5F84;&#x663E;&#x793A;&#x3002;</p>
<p>&#x5728;&#x5173;&#x6CE8;&#x9AD8;&#x4EAE;&#x533A;&#x95F4;&#x4E4B;&#x524D;&#xFF0C;&#x6211;&#x4EEC;&#x5FC5;&#x987B;&#x5148;&#x770B;&#x770B;&#x8DEF;&#x5F84;&#xFF08;path&#xFF09;&#x8FD9;&#x4E2A;&#x5C5E;&#x6027;&#x3002;&#x8DEF;&#x5F84;&#xFF08;path&#xFF09;&#x5C5E;&#x6027;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;&#x8DEF;&#x5F84;&#xFF08;path&#xFF09;&#x5143;&#x7D20;&#x6765;&#x5B9A;&#x4E49;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x5185;&#x4EE3;&#x7406;&#x7684;&#x6EDA;&#x52A8;&#x8DEF;&#x5F84;&#x3002;&#x8DEF;&#x5F84;&#x4F7F;&#x7528;startx&#x4E0E;starty&#x5C5E;&#x6027;&#x6765;&#x94FE;&#x63A5;&#x8DEF;&#x5F84;&#xFF08;path&#xFF09;&#x5143;&#x7D20;&#xFF0C;&#x4F8B;&#x5982;PathLine,PathQuad&#x548C;PathCubic&#x3002;&#x8FD9;&#x4E9B;&#x5143;&#x7D20;&#x90FD;&#x4F7F;&#x7528;&#x4E8C;&#x7EF4;&#x6570;&#x7EC4;&#x6765;&#x6784;&#x9020;&#x8DEF;&#x5F84;&#x3002;</p>
<p>&#x5F53;&#x8DEF;&#x5F84;&#x5B9A;&#x4E49;&#x597D;&#x4E4B;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;PathPercent&#x548C;PathAttribute&#x5143;&#x7D20;&#x6765;&#x8FDB;&#x4E00;&#x6B65;&#x8BBE;&#x7F6E;&#x3002;&#x5B83;&#x4EEC;&#x88AB;&#x653E;&#x7F6E;&#x5728;&#x8DEF;&#x5F84;&#x5143;&#x7D20;&#x4E4B;&#x95F4;&#xFF0C;&#x5E76;&#x4E14;&#x4E3A;&#x7ECF;&#x8FC7;&#x5B83;&#x4EEC;&#x7684;&#x8DEF;&#x5F84;&#x548C;&#x4EE3;&#x7406;&#x63D0;&#x4F9B;&#x66F4;&#x52A0;&#x7EC6;&#x81F4;&#x7684;&#x63A7;&#x5236;&#x3002;PathPercent&#x63D0;&#x4F9B;&#x4E86;&#x5982;&#x4F55;&#x63A7;&#x5236;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x4E4B;&#x95F4;&#x8986;&#x76D6;&#x533A;&#x57DF;&#x90E8;&#x5206;&#x7684;&#x8DEF;&#x5F84;&#xFF0C;&#x7136;&#x540E;&#x53CD;&#x8FC7;&#x6765;&#x63A7;&#x5236;&#x5206;&#x5E03;&#x5728;&#x8FD9;&#x6761;&#x8DEF;&#x5F84;&#x4E0A;&#x7684;&#x4EE3;&#x7406;&#x5143;&#x7D20;&#xFF0C;&#x5B83;&#x4EEC;&#x88AB;&#x6309;&#x6BD4;&#x4F8B;&#x7684;&#x5206;&#x5E03;&#x64AD;&#x653E;&#x3002;</p>
<p>preferredHightlightBegin&#x4E0E;preferredHighlightEnd&#x5C5E;&#x6027;&#x7531;PathView&#xFF08;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF09;&#x8F93;&#x5165;&#x5230;&#x56FE;&#x7247;&#x5143;&#x7D20;&#x4E2D;&#x3002;&#x5B83;&#x4EEC;&#x7684;&#x503C;&#x5728;0~1&#x4E4B;&#x95F4;&#x3002;&#x7ED3;&#x675F;&#x503C;&#x5927;&#x4E8E;&#x7B49;&#x4E8E;&#x5F00;&#x59CB;&#x503C;&#x3002;&#x4F8B;&#x5982;&#x8BBE;&#x7F6E;&#x8FD9;&#x4E9B;&#x5C5E;&#x6027;&#x503C;&#x4E3A;0.5&#xFF0C;&#x5F53;&#x524D;&#x9879;&#x53EA;&#x4F1A;&#x663E;&#x793A;&#x5F53;&#x524D;&#x767E;&#x5206;&#x4E4B;50&#x7684;&#x56FE;&#x50CF;&#x5728;&#x8FD9;&#x4E2A;&#x8DEF;&#x5F84;&#x4E0A;&#x3002;</p>
<p>&#x5728;Path&#x4E2D;&#xFF0C;PathAttribute&#x5143;&#x7D20;&#x4E5F;&#x662F;&#x88AB;&#x653E;&#x7F6E;&#x5728;&#x5143;&#x7D20;&#x4E4B;&#x95F4;&#x7684;&#xFF0C;&#x5C31;&#x50CF;PathPercent&#x5143;&#x7D20;&#x3002;&#x5B83;&#x4EEC;&#x53EF;&#x4EE5;&#x8BA9;&#x4F60;&#x6307;&#x5B9A;&#x5C5E;&#x6027;&#x7684;&#x503C;&#x7136;&#x540E;&#x63D2;&#x5165;&#x7684;&#x8DEF;&#x5F84;&#x4E2D;&#x53BB;&#x3002;&#x8FD9;&#x4E9B;&#x5C5E;&#x6027;&#x4E0E;&#x4EE3;&#x7406;&#x7ED1;&#x5B9A;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x63A7;&#x5236;&#x4EFB;&#x610F;&#x7684;&#x5C5E;&#x6027;&#x3002;</p>
<p><img src="http://qmlbook.org/_images/pathview-coverview.png" alt=""></p>
<p>&#x4E0B;&#x9762;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x5C55;&#x793A;&#x4E86;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x5982;&#x4F55;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x5361;&#x7247;&#x89C6;&#x56FE;&#xFF0C;&#x5E76;&#x4E14;&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x6ED1;&#x52A8;&#x5B83;&#x3002;&#x6211;&#x4EEC;&#x4F7F;&#x7528;&#x4E86;&#x4E00;&#x4E9B;&#x6280;&#x5DE7;&#x6765;&#x5B8C;&#x6210;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x3002;&#x8DEF;&#x5F84;&#x7531;PathLine&#x5143;&#x7D20;&#x7EC4;&#x6210;&#x3002;&#x4F7F;&#x7528;PathPercent&#x5143;&#x7D20;&#xFF0C;&#x5B83;&#x786E;&#x4FDD;&#x4E86;&#x4E2D;&#x95F4;&#x7684;&#x5143;&#x7D20;&#x5C45;&#x4E2D;&#xFF0C;&#x5E76;&#x4E14;&#x7ED9;&#x5176;&#x5B83;&#x7684;&#x5143;&#x7D20;&#x63D0;&#x4F9B;&#x4E86;&#x8DB3;&#x591F;&#x7684;&#x7A7A;&#x95F4;&#x3002;&#x4F7F;&#x7528;PathAttribute&#x5143;&#x7D20;&#x6765;&#x63A7;&#x5236;&#x65CB;&#x8F6C;&#xFF0C;&#x5927;&#x5C0F;&#x548C;&#x6DF1;&#x5EA6;&#x503C;&#xFF08;z-value&#xFF09;&#x3002;</p>
<p>&#x5728;&#x8FD9;&#x4E2A;&#x8DEF;&#x5F84;&#x4E4B;&#x4E0A;&#xFF08;path&#xFF09;&#xFF0C;&#x9700;&#x8981;&#x8BBE;&#x7F6E;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x7684;pathItemCount&#x5C5E;&#x6027;&#x3002;&#x5B83;&#x63A7;&#x5236;&#x4E86;&#x8DEF;&#x5F84;&#x7684;&#x6D53;&#x5BC6;&#x5EA6;&#x3002;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#x7684;&#x8DEF;&#x5F84;&#xFF08;PathView.onPath&#xFF09;&#x4F7F;&#x7528;preferredHighlightBegin&#x4E0E;preferredHighlightEnd&#x6765;&#x63A7;&#x5236;&#x53EF;&#x89C1;&#x7684;&#x4EE3;&#x7406;&#x9879;&#x3002;</p>
<pre><code>    PathView {
        anchors.fill: parent

        delegate: flipCardDelegate
        model: 100

        path: Path {
            startX: root.width/2
            startY: 0

            PathAttribute { name: &quot;itemZ&quot;; value: 0 }
            PathAttribute { name: &quot;itemAngle&quot;; value: -90.0; }
            PathAttribute { name: &quot;itemScale&quot;; value: 0.5; }
            PathLine { x: root.width/2; y: root.height*0.4; }
            PathPercent { value: 0.48; }
            PathLine { x: root.width/2; y: root.height*0.5; }
            PathAttribute { name: &quot;itemAngle&quot;; value: 0.0; }
            PathAttribute { name: &quot;itemScale&quot;; value: 1.0; }
            PathAttribute { name: &quot;itemZ&quot;; value: 100 }
            PathLine { x: root.width/2; y: root.height*0.6; }
            PathPercent { value: 0.52; }
            PathLine { x: root.width/2; y: root.height; }
            PathAttribute { name: &quot;itemAngle&quot;; value: 90.0; }
            PathAttribute { name: &quot;itemScale&quot;; value: 0.5; }
            PathAttribute { name: &quot;itemZ&quot;; value: 0 }
        }

        pathItemCount: 16

        preferredHighlightBegin: 0.5
        preferredHighlightEnd: 0.5
    }
</code></pre><p>&#x4EE3;&#x7406;&#x5982;&#x4E0B;&#x9762;&#x6240;&#x793A;&#xFF0C;&#x4F7F;&#x7528;&#x4E86;&#x4E00;&#x4E9B;&#x4ECE;PathAttribute&#x4E2D;&#x94FE;&#x63A5;&#x7684;&#x5C5E;&#x6027;&#xFF0C;itemZ,itemAngle&#x548C;itemScale&#x3002;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x4EE3;&#x7406;&#x94FE;&#x63A5;&#x7684;&#x5C5E;&#x6027;&#x53EA;&#x5728;wrapper&#x4E2D;&#x53EF;&#x7528;&#x3002;&#x56E0;&#x6B64;&#xFF0C;rotxs&#x5C5E;&#x6027;&#x5728;Rotation&#x5143;&#x7D20;&#x4E2D;&#x5B9A;&#x4E49;&#x4E3A;&#x53EF;&#x8BBF;&#x95EE;&#x503C;&#x3002;</p>
<p>&#x53E6;&#x4E00;&#x4E2A;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x94FE;&#x63A5;&#x7684;PathView.onPath&#x5C5E;&#x6027;&#x7684;&#x7528;&#x6CD5;&#x3002;&#x901A;&#x5E38;&#x5BF9;&#x4E8E;&#x8FD9;&#x4E2A;&#x5C5E;&#x6027;&#x90FD;&#x7ED1;&#x5B9A;&#x4E3A;&#x53EF;&#x89C1;&#xFF0C;&#x8FD9;&#x6837;&#x5141;&#x8BB8;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x7F13;&#x51B2;&#x4E0D;&#x53EF;&#x89C1;&#x7684;&#x5143;&#x7D20;&#x3002;&#x8FD9;&#x4E0D;&#x662F;&#x901A;&#x8FC7;&#x526A;&#x88C1;&#x5904;&#x7406;&#x6765;&#x5B9E;&#x73B0;&#x7684;&#xFF0C;&#x56E0;&#x4E3A;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x7684;&#x4EE3;&#x7406;&#x6BD4;&#x5176;&#x5B83;&#x7684;&#x89C6;&#x56FE;&#xFF0C;&#x4F8B;&#x5982;&#x94FE;&#x8868;&#x89C6;&#x56FE;&#xFF08;ListView&#xFF09;&#x6216;&#x8005;&#x6805;&#x683C;&#x89C6;&#x56FE;&#xFF08;GridView&#xFF09;&#x653E;&#x7F6E;&#x66F4;&#x52A0;&#x968F;&#x610F;&#x3002;</p>
<pre><code>    Component {
        id: flipCardDelegate

        Item {
            id: wrapper

            width: 64
            height: 64

            visible: PathView.onPath

            scale: PathView.itemScale
            z: PathView.itemZ

            property variant rotX: PathView.itemAngle
            transform: Rotation { axis { x: 1; y: 0; z: 0 } angle: wrapper.rotX; origin { x: 32; y: 32; } }

            Rectangle {
                anchors.fill: parent
                color: &quot;lightGray&quot;
                border.color: &quot;black&quot;
                border.width: 3
            }

            Text {
                anchors.centerIn: parent
                text: index
                font.pixelSize: 30
            }
        }
    }
</code></pre><p>&#x5F53;&#x5728;&#x8DEF;&#x5F84;&#x89C6;&#x56FE;&#xFF08;PathView&#xFF09;&#x4E0A;&#x4F7F;&#x7528;&#x56FE;&#x50CF;&#x8F6C;&#x6362;&#x6216;&#x8005;&#x5176;&#x5B83;&#x66F4;&#x52A0;&#x590D;&#x6742;&#x7684;&#x5143;&#x7D20;&#x65F6;&#xFF0C;&#x6709;&#x4E00;&#x4E2A;&#x6027;&#x80FD;&#x4F18;&#x5316;&#x7684;&#x6280;&#x5DE7;&#x662F;&#x7ED1;&#x5B9A;&#x56FE;&#x50CF;&#x5143;&#x7D20;&#xFF08;Image&#xFF09;&#x7684;smooth&#x5C5E;&#x6027;&#x4E0E;PathView.view.moving&#x5C5E;&#x6027;&#x3002;&#x8FD9;&#x610F;&#x5473;&#x7740;&#x56FE;&#x50CF;&#x5728;&#x79FB;&#x52A8;&#x65F6;&#x53EF;&#x80FD;&#x4E0D;&#x591F;&#x5B8C;&#x7F8E;&#xFF0C;&#x4F46;&#x662F;&#x80FD;&#x591F;&#x6BD4;&#x8F83;&#x5E73;&#x6ED1;&#x7684;&#x8F6C;&#x6362;&#x3002;&#x5F53;&#x89C6;&#x56FE;&#x5728;&#x79FB;&#x52A8;&#x65F6;&#xFF0C;&#x5BF9;&#x4E8E;&#x5E73;&#x6ED1;&#x7F29;&#x653E;&#x7684;&#x5904;&#x7406;&#x662F;&#x6CA1;&#x6709;&#x610F;&#x4E49;&#x7684;&#xFF0C;&#x56E0;&#x4E3A;&#x7528;&#x6237;&#x6839;&#x672C;&#x770B;&#x4E0D;&#x89C1;&#x8FD9;&#x4E2A;&#x8FC7;&#x7A0B;&#x3002;</p>
<h2 id="652-xml&#x6A21;&#x578B;&#xFF08;a-model-from-xml&#xFF09;">6.5.2 XML&#x6A21;&#x578B;&#xFF08;A Model from XML&#xFF09;</h2>
<p>&#x7531;&#x4E8E;XML&#x662F;&#x4E00;&#x79CD;&#x5E38;&#x89C1;&#x7684;&#x6570;&#x636E;&#x683C;&#x5F0F;&#xFF0C;QML&#x63D0;&#x4F9B;&#x4E86;XmlListModel&#x5143;&#x7D20;&#x6765;&#x5305;&#x88C5;XML&#x6570;&#x636E;&#x3002;&#x8FD9;&#x4E2A;&#x5143;&#x7D20;&#x80FD;&#x591F;&#x83B7;&#x53D6;&#x672C;&#x5730;&#x6216;&#x8005;&#x7F51;&#x7EDC;&#x4E0A;&#x7684;XML&#x6570;&#x636E;&#xFF0C;&#x7136;&#x540E;&#x901A;&#x8FC7;XPath&#x89E3;&#x6790;&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x5C55;&#x793A;&#x4E86;&#x4ECE;RSS&#x6D41;&#x4E2D;&#x83B7;&#x53D6;&#x56FE;&#x7247;&#xFF0C;&#x6E90;&#x5C5E;&#x6027;&#xFF08;source&#xFF09;&#x5F15;&#x7528;&#x4E86;&#x4E00;&#x4E2A;&#x7F51;&#x7EDC;&#x5730;&#x5740;&#xFF0C;&#x8FD9;&#x4E2A;&#x6570;&#x636E;&#x4F1A;&#x81EA;&#x52A8;&#x4E0B;&#x8F7D;&#x3002;</p>
<p><img src="http://qmlbook.org/_images/xmllistmodel-images.png" alt=""></p>
<p>&#x5F53;&#x6570;&#x636E;&#x4E0B;&#x8F7D;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x5B83;&#x4F1A;&#x88AB;&#x52A0;&#x5DE5;&#x4F5C;&#x4E3A;&#x6A21;&#x578B;&#x7684;&#x5B50;&#x9879;&#x3002;&#x67E5;&#x8BE2;&#x5C5E;&#x6027;&#xFF08;query&#xFF09;&#x662F;&#x4E00;&#x4E2A;XPath&#x4EE3;&#x7406;&#x7684;&#x57FA;&#x7840;&#x67E5;&#x8BE2;&#xFF0C;&#x7528;&#x6765;&#x521B;&#x5EFA;&#x6A21;&#x578B;&#x9879;&#x3002;&#x5728;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x4E2D;&#xFF0C;&#x8FD9;&#x4E2A;&#x8DEF;&#x5F84;&#x662F;/rss/channel/item&#xFF0C;&#x6240;&#x4EE5;&#xFF0C;&#x5728;&#x4E00;&#x4E2A;&#x6A21;&#x578B;&#x5B50;&#x9879;&#x521B;&#x5EFA;&#x540E;&#xFF0C;&#x6BCF;&#x4E00;&#x4E2A;&#x5B50;&#x9879;&#x7684;&#x6807;&#x7B7E;&#xFF0C;&#x90FD;&#x5305;&#x542B;&#x4E86;&#x4E00;&#x4E2A;&#x9891;&#x9053;&#x6807;&#x7B7E;&#xFF0C;&#x5305;&#x542B;&#x4E00;&#x4E2A;RSS&#x6807;&#x7B7E;&#x3002;</p>
<p>&#x6BCF;&#x4E00;&#x4E2A;&#x6A21;&#x578B;&#x9879;&#xFF0C;&#x4E00;&#x4E9B;&#x89C4;&#x5219;&#x9700;&#x8981;&#x88AB;&#x63D0;&#x53D6;&#xFF0C;&#x7531;XmlRole&#x5143;&#x7D20;&#x6765;&#x4EE3;&#x7406;&#x3002;&#x6BCF;&#x4E00;&#x4E2A;&#x89C4;&#x5219;&#x90FD;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x540D;&#x79F0;&#xFF0C;&#x8FD9;&#x6837;&#x4EE3;&#x7406;&#x624D;&#x80FD;&#x591F;&#x901A;&#x8FC7;&#x5C5E;&#x6027;&#x7ED1;&#x5B9A;&#x6765;&#x8BBF;&#x95EE;&#x3002;&#x6BCF;&#x4E2A;&#x8FD9;&#x6837;&#x7684;&#x5C5E;&#x6027;&#x7684;&#x503C;&#x90FD;&#x901A;&#x8FC7;XPath&#x67E5;&#x8BE2;&#x6765;&#x786E;&#x5B9A;&#x3002;&#x4F8B;&#x5982;&#x6807;&#x9898;&#x5C5E;&#x6027;&#xFF08;title&#xFF09;&#x7B26;&#x5408;title/string()&#x67E5;&#x8BE2;&#xFF0C;&#x8FD4;&#x56DE;&#x5185;&#x5BB9;&#x4E2D;&#x5728;&#x4E4B;&#x95F4;&#x7684;&#x503C;&#x3002;</p>
<p>&#x56FE;&#x50CF;&#x6E90;&#x5C5E;&#x6027;&#xFF08;imageSource&#xFF09;&#x66F4;&#x52A0;&#x6709;&#x8DA3;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x4E0D;&#x4EC5;&#x4EC5;&#x662F;&#x4ECE;XML&#x4E2D;&#x63D0;&#x53D6;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x4E5F;&#x9700;&#x8981;&#x52A0;&#x8F7D;&#x5B83;&#x3002;&#x5728;&#x6D41;&#x6570;&#x636E;&#x7684;&#x652F;&#x6301;&#x4E0B;&#xFF0C;&#x6BCF;&#x4E2A;&#x5B50;&#x9879;&#x5305;&#x542B;&#x4E86;&#x4E00;&#x4E2A;&#x56FE;&#x7247;&#x3002;&#x4F7F;&#x7528;XPath&#x7684;&#x51FD;&#x6570;substring-after&#x4E0E;substring-before&#xFF0C;&#x53EF;&#x4EE5;&#x63D0;&#x53D6;&#x672C;&#x5730;&#x7684;&#x56FE;&#x7247;&#x8D44;&#x6E90;&#x3002;&#x8FD9;&#x6837;imageSource&#x5C5E;&#x6027;&#x5C31;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x88AB;&#x4F5C;&#x4E3A;&#x4E00;&#x4E2A;Image&#x5143;&#x7D20;&#x7684;source&#x5C5E;&#x6027;&#x4F7F;&#x7528;&#x3002;</p>
<pre><code>import QtQuick 2.0
import QtQuick.XmlListModel 2.0

Item {
    width: 300
    height: 480

    Component {
        id: imageDelegate

        Item {
            width: listView.width
            height: 400

        Column {
                Text {
                    text: title
                }

                Image {
                    source: imageSource
                }
            }
        }
    }

    XmlListModel {
        id: imageModel

        source: &quot;http://feeds.nationalgeographic.com/ng/photography/photo-of-the-day/&quot;
        query: &quot;/rss/channel/item&quot;

        XmlRole { name: &quot;title&quot;; query: &quot;title/string()&quot; }
        XmlRole { name: &quot;imageSource&quot;; query: &quot;substring-before(substring-after(description/string(), &apos;img src=\&quot;&apos;), &apos;\&quot;&apos;)&quot; }
    }

    ListView {
        id: listView

        anchors.fill: parent

        model: imageModel
        delegate: imageDelegate
    }
}
</code></pre><h2 id="653-&#x94FE;&#x8868;&#x5206;&#x6BB5;&#xFF08;lists-with-sections&#xFF09;">6.5.3 &#x94FE;&#x8868;&#x5206;&#x6BB5;&#xFF08;Lists with Sections&#xFF09;</h2>
<p>&#x6709;&#x65F6;&#xFF0C;&#x94FE;&#x8868;&#x7684;&#x6570;&#x636E;&#x9700;&#x8981;&#x5212;&#x5206;&#x6BB5;&#x3002;&#x4F8B;&#x5982;&#x4F7F;&#x7528;&#x9996;&#x5B57;&#x6BCD;&#x6765;&#x5212;&#x5206;&#x8054;&#x7CFB;&#x4EBA;&#xFF0C;&#x6216;&#x8005;&#x97F3;&#x4E50;&#x3002;&#x4F7F;&#x7528;&#x94FE;&#x8868;&#x89C6;&#x56FE;&#x53EF;&#x4EE5;&#x628A;&#x5E73;&#x9762;&#x5217;&#x8868;&#x6309;&#x7C7B;&#x522B;&#x5212;&#x5206;&#x3002;</p>
<p><img src="http://qmlbook.org/_images/listview-sections.png" alt=""></p>
<p>&#x4E3A;&#x4E86;&#x4F7F;&#x7528;&#x5206;&#x6BB5;&#xFF0C;section.property&#x4E0E;section.criteria&#x5FC5;&#x987B;&#x5B89;&#x88C5;&#x3002;section.property&#x5B9A;&#x4E49;&#x4E86;&#x54EA;&#x4E9B;&#x5C5E;&#x6027;&#x7528;&#x4E8E;&#x5185;&#x5BB9;&#x7684;&#x5212;&#x5206;&#x3002;&#x5728;&#x8FD9;&#x91CC;&#xFF0C;&#x6700;&#x91CD;&#x8981;&#x7684;&#x662F;&#x77E5;&#x9053;&#x6BCF;&#x4E00;&#x6BB5;&#x7531;&#x54EA;&#x4E9B;&#x8FDE;&#x7EED;&#x7684;&#x5143;&#x7D20;&#x6784;&#x6210;&#xFF0C;&#x5426;&#x5219;&#x76F8;&#x540C;&#x7684;&#x5C5E;&#x6027;&#x540D;&#x53EF;&#x80FD;&#x51FA;&#x73B0;&#x5728;&#x51E0;&#x4E2A;&#x4E0D;&#x540C;&#x7684;&#x5730;&#x65B9;&#x3002;</p>
<p>section.criteria&#x80FD;&#x591F;&#x88AB;&#x8BBE;&#x7F6E;&#x4E3A;ViewSection.FullString&#x6216;&#x8005;ViewSection.FirstCharacter&#x3002;&#x9ED8;&#x8BA4;&#x4E0B;&#x4F7F;&#x7528;&#x7B2C;&#x4E00;&#x4E2A;&#x503C;&#xFF0C;&#x80FD;&#x591F;&#x88AB;&#x7528;&#x4E8E;&#x6A21;&#x578B;&#x4E2D;&#x6709;&#x6E05;&#x6670;&#x7684;&#x5206;&#x6BB5;&#xFF0C;&#x4F8B;&#x5982;&#x97F3;&#x4E50;&#x4E13;&#x8F91;&#x3002;&#x7B2C;&#x4E8C;&#x4E2A;&#x662F;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;&#x5C5E;&#x6027;&#x7684;&#x9996;&#x5B57;&#x6BCD;&#x6765;&#x5206;&#x6BB5;&#xFF0C;&#x8FD9;&#x8BF4;&#x660E;&#x4EFB;&#x4F55;&#x5C5E;&#x6027;&#x90FD;&#x53EF;&#x4EE5;&#x88AB;&#x4F7F;&#x7528;&#x3002;&#x901A;&#x5E38;&#x7684;&#x4F8B;&#x5B50;&#x662F;&#x7528;&#x4E8E;&#x8054;&#x7CFB;&#x4EBA;&#x540D;&#x5355;&#x7684;&#x59D3;&#x3002;</p>
<p>&#x5F53;&#x6BB5;&#x88AB;&#x5B9A;&#x4E49;&#x597D;&#x540E;&#xFF0C;&#x6BCF;&#x4E2A;&#x5B50;&#x9879;&#x80FD;&#x591F;&#x4F7F;&#x7528;&#x7ED1;&#x5B9A;&#x5C5E;&#x6027;ListView.section&#xFF0C;ListView.previousSection&#x4E0E;ListView.nextSection&#x6765;&#x8BBF;&#x95EE;&#x3002;&#x4F7F;&#x7528;&#x8FD9;&#x4E9B;&#x5C5E;&#x6027;&#xFF0C;&#x53EF;&#x4EE5;&#x68C0;&#x6D4B;&#x6BB5;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x4E0E;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5B50;&#x9879;&#x3002;</p>
<p>&#x4F7F;&#x7528;&#x94FE;&#x8868;&#x89C6;&#x56FE;&#xFF08;ListView&#xFF09;&#x7684;section.delegate&#x5C5E;&#x6027;&#x53EF;&#x4EE5;&#x7ED9;&#x6BB5;&#x6307;&#x5B9A;&#x4EE3;&#x7406;&#x7EC4;&#x4EF6;&#x3002;&#x5B83;&#x80FD;&#x591F;&#x521B;&#x5EFA;&#x6BB5;&#x6807;&#x9898;&#xFF0C;&#x5E76;&#x4E14;&#x53EF;&#x4EE5;&#x5728;&#x4EFB;&#x610F;&#x5B50;&#x9879;&#x4E4B;&#x524D;&#x63D2;&#x5165;&#x8FD9;&#x4E2A;&#x6BB5;&#x4EE3;&#x7406;&#x3002;&#x4F7F;&#x7528;&#x7ED1;&#x5B9A;&#x5C5E;&#x6027;section&#x53EF;&#x4EE5;&#x8BBF;&#x95EE;&#x5F53;&#x524D;&#x6BB5;&#x7684;&#x540D;&#x79F0;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x4F7F;&#x7528;&#x56FD;&#x9645;&#x5206;&#x7C7B;&#x5C55;&#x793A;&#x4E86;&#x5206;&#x6BB5;&#x7684;&#x4E00;&#x4E9B;&#x6982;&#x5FF5;&#x3002;&#x56FD;&#x7C4D;&#xFF08;nation&#xFF09;&#x4F5C;&#x4E3A;section.property&#xFF0C;&#x6BB5;&#x4EE3;&#x7406;&#x7EC4;&#x4EF6;&#xFF08;section.delegate&#xFF09;&#x4F7F;&#x7528;&#x6BCF;&#x4E2A;&#x56FD;&#x5BB6;&#x4F5C;&#x4E3A;&#x6807;&#x9898;&#x3002;&#x5728;&#x6BCF;&#x4E2A;&#x6BB5;&#x4E2D;&#xFF0C;spacemen&#x6A21;&#x578B;&#x4E2D;&#x7684;&#x540D;&#x5B57;&#x4F7F;&#x7528;spaceManDelegate&#x7EC4;&#x4EF6;&#x6765;&#x4EE3;&#x7406;&#x663E;&#x793A;&#x3002;</p>
<pre><code>import QtQuick 2.0

Rectangle {
    width: 300
    height: 290

    color: &quot;white&quot;

    ListView {
        anchors.fill: parent
        anchors.margins: 20

        clip: true

        model: spaceMen

        delegate: spaceManDelegate

        section.property: &quot;nation&quot;
        section.delegate: sectionDelegate
    }

    Component {
        id: spaceManDelegate

        Item {
            width: 260
            height: 20

            Text {
                anchors.left: parent.left
                anchors.verticalCenter: parent.verticalCenter
                anchors.leftMargin: 10

                font.pixelSize: 12

                text: name
            }
        }
    }

    Component {
        id: sectionDelegate

        Rectangle {
            width: 260
            height: 20

            color: &quot;lightGray&quot;

            Text {
                anchors.left: parent.left
                anchors.verticalCenter: parent.verticalCenter
                anchors.leftMargin: 10

                font.pixelSize: 12
                font.bold: true

                text: section
            }
        }
    }


    ListModel {
        id: spaceMen

        ListElement { name: &quot;Abdul Ahad Mohmand&quot;; nation: &quot;Afganistan&quot;; }
        ListElement { name: &quot;Marcos Pontes&quot;; nation: &quot;Brazil&quot;; }
        ListElement { name: &quot;Alexandar Panayotov Alexandrov&quot;; nation: &quot;Bulgaria&quot;; }
        ListElement { name: &quot;Georgi Ivanov&quot;; nation: &quot;Bulgaria&quot;; }
        ListElement { name: &quot;Roberta Bondar&quot;; nation: &quot;Canada&quot;; }
        ListElement { name: &quot;Marc Garneau&quot;; nation: &quot;Canada&quot;; }
        ListElement { name: &quot;Chris Hadfield&quot;; nation: &quot;Canada&quot;; }
        ListElement { name: &quot;Guy Laliberte&quot;; nation: &quot;Canada&quot;; }
        ListElement { name: &quot;Steven MacLean&quot;; nation: &quot;Canada&quot;; }
        ListElement { name: &quot;Julie Payette&quot;; nation: &quot;Canada&quot;; }
        ListElement { name: &quot;Robert Thirsk&quot;; nation: &quot;Canada&quot;; }
        ListElement { name: &quot;Bjarni Tryggvason&quot;; nation: &quot;Canada&quot;; }
        ListElement { name: &quot;Dafydd Williams&quot;; nation: &quot;Canada&quot;; }
    }
}
</code></pre><h2 id="654-&#x6027;&#x80FD;&#x534F;&#x8C03;&#xFF08;tunning-performance&#xFF09;">6.5.4 &#x6027;&#x80FD;&#x534F;&#x8C03;&#xFF08;Tunning Performance&#xFF09;</h2>
<p>&#x4E00;&#x4E2A;&#x6A21;&#x578B;&#x89C6;&#x56FE;&#x7684;&#x6027;&#x80FD;&#x5F88;&#x5927;&#x7A0B;&#x5EA6;&#x4E0A;&#x4F9D;&#x8D56;&#x4E8E;&#x4EE3;&#x7406;&#x7684;&#x521B;&#x5EFA;&#x3002;&#x4F8B;&#x5982;&#x6EDA;&#x52A8;&#x4E0B;&#x62C9;&#x4E00;&#x4E2A;&#x94FE;&#x8868;&#x89C6;&#x56FE;&#x65F6;&#xFF0C;&#x4EE3;&#x7406;&#x4ECE;&#x5916;&#x90E8;&#x52A0;&#x5165;&#x5230;&#x89C6;&#x56FE;&#x5E95;&#x90E8;&#xFF0C;&#x5E76;&#x4E14;&#x4ECE;&#x89C6;&#x56FE;&#x9876;&#x90E8;&#x79FB;&#x51FA;&#x3002;&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x526A;&#x88C1;&#xFF08;clip&#xFF09;&#x5C5E;&#x6027;&#x4E3A;false&#xFF0C;&#x5E76;&#x4E14;&#x4EE3;&#x7406;&#x9879;&#x82B1;&#x4E86;&#x5F88;&#x591A;&#x65F6;&#x95F4;&#x6765;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x7528;&#x6237;&#x4F1A;&#x611F;&#x89C9;&#x5230;&#x89C6;&#x56FE;&#x6EDA;&#x52A8;&#x4F53;&#x9A8C;&#x5F88;&#x5DEE;&#x3002;</p>
<p>&#x4E3A;&#x4E86;&#x4F18;&#x5316;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x5728;&#x6EDA;&#x52A8;&#x65F6;&#x4F7F;&#x7528;&#x50CF;&#x7D20;&#x6765;&#x8C03;&#x6574;&#x3002;&#x4F7F;&#x7528;cacheBuffer&#x5C5E;&#x6027;&#xFF0C;&#x5728;&#x4E0A;&#x8BC9;&#x60C5;&#x51B5;&#x4E0B;&#x7684;&#x5782;&#x76F4;&#x6EDA;&#x52A8;&#xFF0C;&#x5B83;&#x5C06;&#x4F1A;&#x8C03;&#x6574;&#x5728;&#x94FE;&#x8868;&#x89C6;&#x56FE;&#x7684;&#x4E0A;&#x4E0B;&#x9700;&#x8981;&#x9884;&#x5148;&#x51C6;&#x5907;&#x597D;&#x591A;&#x5C11;&#x50CF;&#x7D20;&#x7684;&#x4EE3;&#x7406;&#x9879;&#xFF0C;&#x7ED3;&#x5408;&#x5F02;&#x6B65;&#x52A0;&#x8F7D;&#x56FE;&#x50CF;&#x5143;&#x7D20;&#xFF08;Image&#xFF09;&#xFF0C;&#x4F8B;&#x5982;&#x5728;&#x5B83;&#x4EEC;&#x8FDB;&#x5165;&#x89C6;&#x56FE;&#x4E4B;&#x524D;&#x52A0;&#x8F7D;&#x3002;</p>
<p>&#x521B;&#x5EFA;&#x66F4;&#x591A;&#x7684;&#x4EE3;&#x7406;&#x9879;&#x5C06;&#x4F1A;&#x727A;&#x7272;&#x4E00;&#x4E9B;&#x6D41;&#x7545;&#x7684;&#x4F53;&#x9A8C;&#xFF0C;&#x5E76;&#x4E14;&#x82B1;&#x66F4;&#x591A;&#x7684;&#x65F6;&#x95F4;&#x6765;&#x521D;&#x59CB;&#x5316;&#x6BCF;&#x4E2A;&#x4EE3;&#x7406;&#x3002;&#x8FD9;&#x5E76;&#x4E0D;&#x4EE3;&#x8868;&#x53EF;&#x4EE5;&#x89E3;&#x51B3;&#x4E00;&#x4E9B;&#x66F4;&#x52A0;&#x590D;&#x6742;&#x7684;&#x4EE3;&#x7406;&#x9879;&#x7684;&#x95EE;&#x9898;&#x3002;&#x5728;&#x6BCF;&#x6B21;&#x5B9E;&#x4F8B;&#x5316;&#x4EE3;&#x7406;&#x65F6;&#xFF0C;&#x5B83;&#x7684;&#x5185;&#x5BB9;&#x90FD;&#x4F1A;&#x88AB;&#x8BC4;&#x4F30;&#x548C;&#x7F16;&#x8F91;&#x3002;&#x8FD9;&#x9700;&#x8981;&#x82B1;&#x8D39;&#x65F6;&#x95F4;&#xFF0C;&#x5982;&#x679C;&#x5B83;&#x82B1;&#x8D39;&#x4E86;&#x592A;&#x591A;&#x7684;&#x65F6;&#x95F4;&#xFF0C;&#x5B83;&#x5C06;&#x4F1A;&#x5BFC;&#x81F4;&#x4E00;&#x4E2A;&#x5F88;&#x5DEE;&#x7684;&#x6EDA;&#x52A8;&#x4F53;&#x9A8C;&#x3002;&#x5728;&#x4E00;&#x4E2A;&#x4EE3;&#x7406;&#x4E2D;&#x5305;&#x542B;&#x592A;&#x591A;&#x7684;&#x5143;&#x7D20;&#x4E5F;&#x4F1A;&#x964D;&#x4F4E;&#x6EDA;&#x52A8;&#x7684;&#x6027;&#x80FD;&#x3002;</p>
<p>&#x4E3A;&#x4E86;&#x8865;&#x6551;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#xFF0C;&#x6211;&#x4EEC;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#x52A8;&#x6001;&#x52A0;&#x8F7D;&#x5143;&#x7D20;&#x3002;&#x5F53;&#x5B83;&#x4EEC;&#x9700;&#x8981;&#x65F6;&#xFF0C;&#x53EF;&#x4EE5;&#x521D;&#x59CB;&#x5316;&#x8FD9;&#x4E9B;&#x9644;&#x52A0;&#x7684;&#x5143;&#x7D20;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x4E00;&#x4E2A;&#x5C55;&#x5F00;&#x4EE3;&#x7406;&#x53EF;&#x80FD;&#x63A8;&#x8FDF;&#x5B83;&#x7684;&#x8BE6;&#x7EC6;&#x5185;&#x5BB9;&#x7684;&#x5B9E;&#x4F8B;&#x5316;&#xFF0C;&#x76F4;&#x5230;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x5B83;&#x65F6;&#x3002;&#x6BCF;&#x4E2A;&#x4EE3;&#x7406;&#x4E2D;&#x6700;&#x597D;&#x51CF;&#x5C11;JavaScript&#x7684;&#x6570;&#x91CF;&#x3002;&#x5C06;&#x6BCF;&#x4E2A;&#x4EE3;&#x7406;&#x4E2D;&#x590D;&#x6742;&#x7684;JavaScript&#x8C03;&#x7528;&#x653E;&#x5728;&#x5916;&#x9762;&#x6765;&#x5B9E;&#x73B0;&#x3002;&#x8FD9;&#x5C06;&#x4F1A;&#x51CF;&#x5C11;&#x6BCF;&#x4E2A;&#x4EE3;&#x7406;&#x5728;&#x521B;&#x5EFA;&#x65F6;&#x7F16;&#x8BD1;JavaScript&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="delegate.html" class="navigation navigation-prev " aria-label="Previous page: 代理（Delegate）">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="summary.html" class="navigation navigation-next " aria-label="Next page: 总结（Summary）">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"高级用法（Advanced Techniques）","level":"1.7.5","depth":2,"next":{"title":"总结（Summary）","level":"1.7.6","depth":2,"path":"model-view-delegate/summary.md","ref":"model-view-delegate/summary.md","articles":[]},"previous":{"title":"代理（Delegate）","level":"1.7.4","depth":2,"path":"model-view-delegate/delegate.md","ref":"model-view-delegate/delegate.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"model-view-delegate/advanced_techniques.md","mtime":"2021-05-30T14:00:08.737Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-05-30T14:16:45.097Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

